echo "Invalid no of arguments passed to function delete "
return
fi
if [ -s "${1}" ] ; then
sudo rm -rf "${1}"
fi
}
uninstallnwa()
{
if [ -s "/Library/NETAepoagt" ] ; then
sudo SystemStarter stop nwa
echo "removing nwa components"
for i in /Library/Receipts/NWA.pkg /Library/NETAepoagt /Library/StartupItems/nwa /Applications/Utilities/ePO\ Agent\ Configurator.app /Library/NETASSOC
do
delete "$i"
done
fi
}
deletelink()
{
if [ $# -lt 1 ] ; then
echo "Invalid no of arguments passed to function delete "
return
fi
if [ -L "${1}" ] ; then
sudo rm -rf "${1}"
fi
}
deleteHotfixes()
{
# the deletion of hotfix receipts is on the assumption that hotfix gets installed in name VirusscanHf_______.pkg
# uninstaller is also used as preflight if number of input is greater than 2 then we can assume that uninstaller is called by preflight hence do not echo uninstall VirusScan for Mac
if [ $# -lt 2 ]
then
echo "VirusScan for Mac Uninstall"
echo "-------------------"
echo "This will uninstall VirusScan for Mac."
fi
usercheck=`id | grep uid=0 | wc -l`
if [ "$usercheck" -eq 0 ] ; then
echo " If you wish to proceed, authenticate below"
echo " or close this window if you wish to cancel."
fi
# sudo -k
sudo echo ""
val=$?
if [ $val -ne 0 ]
then
echo "permission denied"
exit -1
fi
if [ $# -lt 2 ]; then
echo "Uninstalling VirusScan ..."
cd /
else
uninstallnwa
# uninstall nwa from our preflight
fi
# Stop all the daemons that are currently running
StopVirexDaemons
# Unloading all the daemons that are currently running
UnloadVirexDaemons
# call kill process here #TODO Proper Shutdown
shutdownprocess
#killvirex77process
# delete files related to 8.6.1
virex861
# delete files related to 8.6
virex86
# delete files related to 8.5.1
virex851
# delete files related to 8.5
virex85
# delete files related to 8.0
virex80
# delete files related to 7.7
virex77
# delete files related to 7.2
virex72
# delete files related to old preferences
OldPreferenceDelete
# remove Library receipts files for Hotfixes installed
deleteHotfixes
if [ $# -lt 2 ]; then
echo " "
echo "VirusScan has been successfully uninstalled."